libxl_internal: make JSON_* types a bit-field
authorWei Liu <wei.liu2@citrix.com>
Tue, 13 May 2014 21:53:55 +0000 (22:53 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 21 May 2014 10:00:44 +0000 (11:00 +0100)
commitf68570ac7715ee2b338dfd8edc18b99901aebb9a
treeef30d2c38f91fbef2e55039a60bc6d804d581a5a
parenta84725c201cffe714b91ace83b5dd381c879ba5b
libxl_internal: make JSON_* types a bit-field

Libxl can generate number as type JSON_INTEGER, JSON_DOUBLE or
JSON_NUMBER, string as type JSON_STRING or JSON_NULL (if string is
null).

So make JSON_* type a bit-field and use it in libxl__json_map_get. This is
useful when parsing a libxl__json_object to libxl_FOO struct. We can
enforce type checking on libxl__json_object in an easy way.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_internal.h
tools/libxl/libxl_json.c